//
//  ZZCAlterGestureController.m
//  ZZC-Finance
//
//  Created by mac on 2017/5/25.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "ZZCAlterGestureController.h"
#import "ZZCGestureView.h"
#import "ZZCAlterGestureView.h"
@interface ZZCAlterGestureController ()
@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (strong, nonatomic) ZZCGestureView *gesView;
@property (strong, nonatomic) ZZCAlterGestureView *AGView;

@end

@implementation ZZCAlterGestureController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)viewDidLayoutSubviews {
    self.gesView = [[ZZCGestureView alloc]initWithFrame:self.bgView.bounds];

    [self.bgView addSubview:self.gesView];
    ZZCLog(@"%@",NSStringFromCGRect(self.bgView.frame));
}

- (IBAction)backClick {
    [self.navigationController popViewControllerAnimated:YES];
}
//验证密码登录
- (IBAction)testPasswordClick {
    [self.view addSubview:self.AGView];
    [self.AGView.confirmBtn addTarget:self action:@selector(confirmBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.AGView.cancelBtn addTarget:self action:@selector(cancelBtnClick) forControlEvents:UIControlEventTouchUpInside];
}
- (void)confirmBtnClick {
    ZZCLog(@"确认-");
    [self.AGView removeFromSuperview];
}
- (void)cancelBtnClick {
    ZZCLog(@"取消-");
    [self.AGView removeFromSuperview];
}

- (ZZCAlterGestureView *)AGView {
    if (_AGView == nil) {
        _AGView = [ZZCAlterGestureView alterGestureView];
        _AGView.frame = CGRectMake(0, 0, ZZCScreenW, ZZCScreenH);
        _AGView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
    }
    return _AGView;
}

@end
